<?php
class Persona extends AppModel {
	var $name = 'Persona';
	var $useDbConfig = 'seguridad';
	var $validate = array(
		'nombres' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo es obligatorio',
				//'allowEmpty' => false,
				'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'apellidos' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo es obligatorio',
				//'allowEmpty' => false,
				'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'cedula' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'Solo se admiten numeros en este campo',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'minlength' => array(
				'rule' => array('minlength', 7),
				//'message' => 'Your custom message here',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'rif' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'telefono' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'El campo solo admite numeros',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'correo' => array(
			'email' => array(
				'rule' => array('email'),
				'message' => 'Debe colocar un formato valido de e-mail',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'fl_ingreso' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'fl_egreso' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'fecha_nacimiento' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'razon_social' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'usuario_id' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'sw_activo' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),
		'salario' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),

		'telefono_movil' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),

		'cooperativa' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),

    	'sw_tipo' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),

		'sw_tipo' => array(
			'notempty' => array(
				'rule' => array('notempty'),
				'message' => 'El campo no puede estar vacio',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),


		'correo2' => array(
			'email' => array(
				'rule' => array('email'),
				'message' => 'Debe colocar un formato valido de e-mail',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),


		'correo3' => array(
             'email' => array(
				'rule' => array('email'),
				'message' => 'Debe colocar un formato valido de e-mail',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),

		'nro_cert' => array(
			'numeric' => array(
				'rule' => array('numeric'),
				'message' => 'El campo solo admite numeros',
				//'allowEmpty' => false,
				//'required' => false,
				//'last' => false, // Stop validation after this rule
				//'on' => 'create', // Limit validation to 'create' or 'update' operations
			),
		),


	);
	//The Associations below have been created with all possible keys, those that are not needed can be removed

//	var $belongsTo = array(
//		'Usuario' => array(
//			'className' => 'Usuario',
//			'foreignKey' => 'usuario_id',
//			'conditions' => '',
//			'fields' => '',
//			'order' => ''
//		)
//	);

	var $hasMany = array(
		'Usuario' => array(
			'className' => 'Usuario',
			'foreignKey' => 'persona_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
?>